Try harder to return pixbufs of the requested size. (#494515, Mike
authorMatthias Clasen <mclasne@redhat.com>
Sun, 10 Feb 2008 06:27:46 +0000 (06:27 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Sun, 10 Feb 2008 06:27:46 +0000 (06:27 +0000)
2008-02-10  Matthias Clasen  <mclasne@redhat.com>

        * gdk-pixbuf-scaled-anim.c: Try harder to return pixbufs
        of the requested size.  (#494515, Mike Morrison)

svn path=/trunk/; revision=19504

gdk-pixbuf/ChangeLog
gdk-pixbuf/gdk-pixbuf-scaled-anim.c

index 5e38b4bf1180900ccf6a8b7df66704ec8f5ab85a..2c45fec75fd90024e336292108f929514f0aab65 100644 (file)
@@ -1,3 +1,8 @@
+2008-02-10  Matthias Clasen  <mclasne@redhat.com>
+
+       * gdk-pixbuf-scaled-anim.c: Try harder to return pixbufs
+       of the requested size.  (#494515, Mike Morrison)
+
 2008-01-15  Matthias Clasen  <mclasne@redhat.com>
 
        * gdk-pixbuf-io.c (save_to_stream): Handle partial writes.
index b9b593dd2cf55c0826212820639e6ce7078ac02b..06d1cc087d909df3c8ccf620867c647e233b56e5 100644 (file)
@@ -139,8 +139,8 @@ get_scaled_pixbuf (GdkPixbufScaledAnim *scaled,
 
        /* Get a new scaled pixbuf */
        scaled->current  = gdk_pixbuf_scale_simple (pixbuf, 
-                       (int) (gdk_pixbuf_get_width (pixbuf) * scaled->xscale),
-                       (int) (gdk_pixbuf_get_height (pixbuf) * scaled->yscale),
+                       (int) (gdk_pixbuf_get_width (pixbuf) * scaled->xscale + .5),
+                       (int) (gdk_pixbuf_get_height (pixbuf) * scaled->yscale + .5),
                        GDK_INTERP_BILINEAR);
 
        /* Copy the original pixbuf options to the scaled pixbuf */
@@ -170,9 +170,9 @@ get_size (GdkPixbufAnimation *anim,
 
         GDK_PIXBUF_ANIMATION_GET_CLASS (scaled->anim)->get_size (scaled->anim, width, height);
        if (width) 
-               *width = (int)(*width * scaled->xscale);
+               *width = (int)(*width * scaled->xscale + .5);
        if (height)
-               *height = (int)(*height * scaled->yscale);
+               *height = (int)(*height * scaled->yscale + .5);
 }
 
 static GdkPixbufAnimationIter *